package com.ssm.modules.service.impl;

import com.ssm.modules.dao.IRoleDao;
import com.ssm.modules.entity.Role;
import com.ssm.modules.service.IRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("roleService")
public class RoleServiceImpl implements IRoleService {

    @Autowired
    private IRoleDao roleDao;

    public List<Role> findAllRole() {
        return roleDao.findAllRole();
    }

    public int addRole(Role role){ return  roleDao.addRole(role); }

    public int updateRole (Role role){ return  roleDao.updateRole(role); }

    public  int deleteRole(int id){
        return roleDao.deleteRole(id);
    }

    public int userAddRole(int userId, int roleId) {
        return roleDao.userAddRole(userId, roleId);
    }
}
